package com.naiterui.ehp.bp.domain.education;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * 宣教数据统计

 * @version 2017年3月30日 by wangchuan
 */
@Entity
@Table(name = "edu_analysis")
@DynamicInsert(true)// 使用数据库的默认值
@DynamicUpdate(true)
public class EduAnalysis implements Serializable {

    private static final long serialVersionUID = -5468416082409386002L;

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    private Long id;

    @Column(name = "doctor_id")
    private Long doctorId;          // 医生ID

    @Column(name = "edu_id")
    private Long eduId;             // 宣教id

    @Column(name = "message_id")
    private String messageId;       // 消息ID

    @Column(name = "read_count")
    private int readCount;          // 患者阅读数

    @Column(name = "created_at")
    private Date createdAt;         // 创建时间

    @Column(name = "changed_at")
    private Date changedAt;         // 修改时间

    @Column(name = "created_by")
    private String createdBy;       // 创建人

    @Column(name = "changed_by")
    private String changedBy;       // 修改人

    @Version
    private Integer version;

    public EduAnalysis() {
        super();
    }

    public EduAnalysis(Long eduId, Long doctorId, String messageId, int readCount) {
        this.eduId = eduId;
        this.doctorId = doctorId;
        this.messageId = messageId;
        this.readCount = readCount;
        this.createdAt = new Date();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getDoctorId() {
        return doctorId;
    }

    public void setDoctorId(Long doctorId) {
        this.doctorId = doctorId;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getChangedAt() {
        return changedAt;
    }

    public void setChangedAt(Date changedAt) {
        this.changedAt = changedAt;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public String getChangedBy() {
        return changedBy;
    }

    public void setChangedBy(String changedBy) {
        this.changedBy = changedBy;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }

    public int getReadCount() {
        return readCount;
    }

    public void setReadCount(int readCount) {
        this.readCount = readCount;
    }

    public Long getEduId() {
        return eduId;
    }

    public void setEduId(Long eduId) {
        this.eduId = eduId;
    }

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }
}
